package com.ita.comdept.impl;

import java.rmi.RemoteException;
import java.util.List;

import com.ita.command.Command;
import com.ita.dao.DepartmentDao;
import com.ita.dao.PeopleDao;
import com.ita.po.Department;
import com.ita.po.People;
import com.ita.po.ReturnValue;

public class CmdAllDept implements Command {
	
	private DepartmentDao departmentDao;
	

	
	public CmdAllDept(DepartmentDao departmentDao) {
		super();
		this.departmentDao =departmentDao;
	}


	@Override
	public ReturnValue execute() throws RemoteException {
		List<Department> list = departmentDao.showAllDepartment();
		for(Department d : list){
			System.out.println(d.toString());
		}
		ReturnValue returnValue = new ReturnValue();
		returnValue.setdList(list);
		return returnValue;
	}

}
